  export default function updater(state, action) {
    switch (action.type) {
      case "selectLeft":
      console.log("left----------",action.id);
        let list = state.leftList;
        for(let i=0;i<list.length;i++){
          let item = list[i];
          if (item.id === action.id) {
              state.rightList.push(item);
              state.leftList.splice(i, 1);
          }
        }
        console.log(state.leftList.length);
        console.log(state.rightList.length);
        return Object.assign({}, state, {rightList:state.rightList, leftList:state.leftList});
        break;
      case "selectRight":
        console.log("right+++++++++++++++",action.id);
        let list2 = state.rightList;
        for(let i=0;i<list2.length;i++){
          let item = list2[i];
          if (item.id === action.id) {
              state.leftList.push(item);
              state.rightList.splice(i, 1);
          }
        }
          return Object.assign({}, state, {rightList:state.rightList, leftList:state.leftList});
        break;
      default:
        return state;
    }
  }
